const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const sampleVillageSchema = new mongoose.Schema({
  //日期
  date: {
    type: String,
    required: [true, "you must tell us your date"],
  },
  //省
  province: {
    type: String,
  },
  //省key
  provinceKey: {
    type: String,
  },
  //市
  city: {
    type: String,
  },
  //市key
  cityKey: {
    type: String,
  },
  //区
  area: {
    type: String,
  },
  //区key
  areaKey: {
    type: String,
  },
  //乡镇
  street: {
    type: String,
  },
  //村
  village: {
    type: String,
  },
  //村属性
  property: {
    type: String,
    required: [true, "you must tell us your property"],
  },
  //调查方式
  researchType: {
    type: String,
    required: [true, "you must tell us your researchType"],
  },
  //样本村类型
  type: {
    type: String,
    enum: ["unpublish", "publishing"],
    required: [true, "you must tell us your type"],
  },
  //发布给第几组
  group: {
    type: String,
    required: [true, "you must tell us your group"],
  },
});

const SampleVillage = mongoose.model("SampleVillage", sampleVillageSchema);
module.exports = SampleVillage;
